home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / bin / update.pl < prev    next >
Perl Script  |  1997-01-16  |  37KB  |  1,086 lines

  1. #!/usr/lab/bin/perl 
  2. # ------------------------------------------------------------
  3.  
  4. # update.pl, by Jean-Pierre Girard (jpg@corrado.sun.com)
  5. # This allows the user to edit or create the _info file
  6. # necessary for the SunSolutions.
  7. # version 1.0, Feb, 20 1996
  8. # ------------------------------------------------------------
  9.  
  10. # Bugs and other fixes
  11.  
  12. # ------------------------------------------------------------
  13. %Special = (
  14. "internet", "596,200"
  15. ,"Sun", "596,167"
  16. );
  17.  
  18. %GifImage = (
  19. "archive", "sstormn.gif"
  20. ,"business", "sbizsol.gif"
  21. , "cad_cae", "scade.gif"
  22. , "catalogs", "scata.gif"
  23. , "client_server", "sclnt.gif"
  24. , "desktop_apps", "sdesk.gif"
  25. , "diag_flow", "sdiaflo.gif"
  26. , "doc_mgt", "sdocmn.gif"
  27. , "epubs", "selecpb.gif"
  28. , "graphics_imaging", "sgfximg.gif"
  29. , "info_mgt", "sinfomn.gif"
  30. , "multimedia", "smulti.gif"
  31. , "networking", "snetwk.gif"
  32. , "security", "ssecu.gif"
  33. , "sw_eng", "ssfteng.gif"
  34. , "sys_admin", "ssysad.gif"
  35. , "telco", "stelco.gif"
  36. , "training", "strain.gif"
  37. #Below are not subs
  38. , "access", "intacc.gif"
  39. , "service", "intserv.gif"
  40. , "commerce", "intcomm.gif"
  41. , "publishing", "intpub.gif"
  42. , "intsecurity", "intsec.gif"
  43. , "Hardware", "hard.gif"
  44. , "Services", "serv.gif"
  45. , "companies", "comps.gif"
  46. , "Sun", "sprods.gif"
  47. );
  48.  
  49. %Categories = (
  50. #These appear on front gui
  51. "access", "Internet Access"
  52. , "service", "Services for the Internet"
  53. , "commerce", "Internet Commerce"
  54. , "publishing", "Internet Publishing"
  55. , "intsecurity", "Internet Security"
  56. , "Hardware", ""
  57. , "Services", ""
  58. , "companies", ""
  59. , "Sun", "Search Sun Products <form method=get ACTION=http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions></font><input type=text name=isindex size=15>"
  60. #These are Software subs
  61. ,"archive", "Archiving, Storage Management & Backup Solutions"
  62. ,"business", "Business Solutions"
  63. , "cad_cae", "Computer Aided Design/Engineering"
  64. , "catalogs", "Catalogs"
  65. , "client_server", "Client/Server Solutions"
  66. , "desktop_apps", "Desktop Applications"
  67. , "diag_flow", "Diagramming and Flowcharting"
  68. , "doc_mgt", "Document Management"
  69. , "epubs", "Electronic Publishing"
  70. , "graphics_imaging", "Graphics and Imaging"
  71. , "info_mgt", "Information Management"
  72. , "multimedia", "Multimedia"
  73. , "networking", "Networking"
  74. , "security", "Security"
  75. , "sw_eng", "Software Engineering"
  76. , "sys_admin", "System Administration"
  77. , "telco", "Telecommunications"
  78. , "training", "Training"
  79. );
  80.  
  81. ##############################################################################
  82. # PrintHtml:
  83. ##############################################################################
  84. sub PrintHtml
  85. {
  86.     local($StrHtml1, $Str, $StrHtml2) = @_;
  87.     
  88.     if ($HTML_FORMAT eq "true") {
  89.         print STDOUT $StrHtml1;
  90.     }
  91.  
  92.     print STDOUT $Str;
  93.  
  94.     if ($HTML_FORMAT eq "true") {
  95.         print STDOUT $StrHtml2;
  96.     }
  97. }
  98. ##############################################################################
  99. # CheckLinks:
  100. ##############################################################################
  101. sub CheckLinks
  102. {
  103.     &PrintHtml("<BR>", "\nChecking links1...\n", "<BR>");
  104.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  105.     $ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  106.     #$ListDir =~ s/\n+/ /g;
  107.     @dirfields = split(/\s+/, $ListDir);
  108.     foreach $Dir (@dirfields) {
  109.         if ($Dir =~ /SunSolutions|DEV/) {
  110.             next;
  111.         }
  112.         &PrintHtml("<DD><DD>",  "\t\tTesting $Dir ...\n", "<BR>");
  113.         $ListFiles = `find "$PRODUCTS_DIR/$Dir" -name "*.html" -print`;
  114.         $ListFiles .= `find "$PRODUCTS_DIR/$Dir" -name "*.htm" -print`;
  115.         #$ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  116.         @filefields = split(/\s+/, $ListFiles);
  117.         foreach $File (@filefields) {
  118.             if ($File =~ /SunSolutions.(frame|head).html/) {
  119.                 next;
  120.             }
  121.             #&PrintHtml("<DD><DD>",  "\t\tTesting $File ...\n", "<BR>");
  122.             if (open (HTMLFILE, $File)) {
  123.                 while(<HTMLFILE>) {
  124.                     chop;
  125.                     $Line = $_;
  126.                     $LinePrint = $Line;
  127.                     if ($HTML_FORMAT eq "true") {
  128.                         $LinePrint =~ s/</</g;
  129.                         $LinePrint =~ s/>/>/g;
  130.                     }
  131.                     if ($Line =~ /HREF/i) {
  132.                         $Ref = $Line;
  133.                         $Ref =~ s/.*HREF *= *"?([^" >#]*)[" >#].*/\1/i;
  134.                         if ($Ref =~ /HrefButtonArea/) {
  135.                             $Ref =~ s/.*HrefButtonArea,\d+,\d+,\d+,\d+,([^" >]*)/\1/;
  136.                         }
  137.                         #print "\t$Line\n\t->$Ref\n";
  138.                         if ($Ref eq $Line) {
  139.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  140.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  141.                         }
  142.                         if ($Ref eq "" && $Line !~ /HREF *= *"?\#/i) {
  143.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  144.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  145.                         }
  146.                         if ($Ref !~ /mailto:|ftp:|http:\/\/|req_more_info.pl/i || $Ref =~ /http:\/\/localhost/) {
  147.                         #if ($Ref !~ /mailto:|ftp:|http:\/\/[^l]|req_more_info.pl/i) {
  148.                             #print "->$Ref\n";
  149.                             $ShortDir = $File;
  150.                             $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  151.                             if ($Ref =~ /http:\/\/localhost/i) {
  152.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  153.                                 #print "\t\tin http:$ShortDir/$Ref from $File\n";
  154.                                 if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  155.                                     &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  156.                                 }
  157.                             } elsif ($Ref =~ /file:/i) {
  158.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  159.                                 #print "\t\tin file: $Ref from $File\n";
  160.                                 unless (-s "$Ref") {
  161.                                     &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  162.                                 }
  163.                             } else {
  164.                                 #print "\t\tin else: $ShortDir/$Ref from $File\n";
  165.                                 if ($Ref !~ /^#/) {
  166.                                     unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  167.                                         &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  168.                                     }
  169.                                 }
  170.                             }
  171.                         }
  172.                         
  173.                     }
  174.                     if ($Line =~ /<IMG/i) {
  175.                         $Ref = $Line;
  176.                         $Ref =~ s/.*IMG.*SRC *= *"?([^" >]*)[" >].*/\1/i;
  177.                         #print "\t$Line\n\t->$Ref\n";
  178.                         if ($Ref eq $Line) {
  179.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  180.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  181.                         }
  182.                         if ($Ref eq "") {
  183.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  184.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  185.                         }
  186.                         #print "->$Ref\n";
  187.                         $ShortDir = $File;
  188.                         $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  189.                         if ($Ref =~ /http:\/\/localhost/i) {
  190.                             $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  191.                             #print "\t\tin http:$ShortDir/$Ref from $File\n";
  192.                             if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  193.                                 &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  194.                             }
  195.                         } elsif ($Ref =~ /file:/i) {
  196.                             $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  197.                             #print "\t\tin file: $Ref from $File\n";
  198.                             unless (-s "$Ref") {
  199.                                 &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  200.                             }
  201.                         } else {
  202.                             #print "\t\tin else: $ShortDir/$Ref from $File\n";
  203.                             if ($Ref !~ /^#/) {
  204.                                 unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  205.                                     &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  206.                                 }
  207.                             }
  208.                         }
  209.                         
  210.                     }
  211.                     #$Line =~ tr/
  212.                 }
  213.                 close(HTMLFILE);
  214.             } else {
  215.                 &PrintHtml("<B>",  "ERROR: $File cannot be open\n", "</B><BR>");
  216.             }
  217.         }
  218.     }
  219. }
  220. ##############################################################################
  221. # CheckFiles:
  222. ##############################################################################
  223. sub CheckFiles
  224. {
  225.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  226.     $ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  227.     #$ListDir =~ s/\n+/ /g;
  228.     @filefields = split(/\s+/, $ListDir);
  229.     foreach $Dir (@filefields) {
  230.         unless (-s "$PRODUCTS_DIR/$Dir/_info") {
  231.             &PrintHtml("", "WARNING: _info file missing in $Dir\n", "<BR>");
  232.         }
  233.     }
  234.     #print $ListDir;
  235. }
  236.  
  237. ##############################################################################
  238. # InitCompInfo:
  239. ##############################################################################
  240. sub InitCompInfo
  241. {
  242.     #$ListDir = `ls $PRODUCTS_DIR/[CD]*/_info`;
  243.     $ListDir = `ls $PRODUCTS_DIR/*/_info`;
  244.     #print "ls $PRODUCTS_DIR/*/_info";
  245.  
  246.     @filefields = split(/\s+/, $ListDir);
  247.     #print $filefields;
  248.     foreach $INFOFILENAME (@filefields) {
  249.         $ShortDir = $INFOFILENAME;
  250.         $ShortDir =~ s?.*/([^/]*)/_info$?\1?;
  251.         if (-s $INFOFILENAME && open (INFOFILE, $INFOFILENAME)) {
  252.             if ($REPORT ne "true") {
  253.                 #&PrintHtml("<DD><DD>", "\t\tReading $INFOFILENAME\n", "<BR>");
  254.             }
  255.     
  256.                     while (<INFOFILE>) {
  257.                         $Line = $_;
  258.                 unless ($Line =~ /^[     ]*$/ || $Line =~ /^#/) {
  259.                     last;
  260.                 }
  261.             }
  262.                     ($Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}) = split(/\^/, $Line);
  263.  
  264.             if ($CHECK eq "true") {
  265.                 $_ = $Line;
  266.                 #print "Line=$Line\n";
  267.                 $count = tr/^//;
  268.                 #print "$_: $count\n";
  269.                 if ($count != 7) {
  270.                     &PrintHtml("<B>", "ERROR: Not the correct number of parameters in the first line of $INFOFILENAME\n", "<BR>");
  271.                 }
  272.                 if ($Platform{$ShortDir} =~ /demo|testdrive|install/ && ! -d "$PRODUCTS_DIR/$ShortDir/_install") {
  273.                     &PrintHtml("<B>", "ERROR: Missing _install directory in $ShortDir\n", "<BR>");
  274.                 }
  275.                 if ($HomePageName{$ShortDir} eq "") {
  276.                     &PrintHtml("<B>", "ERROR: Missing Home page name in $ShortDir\n", "<BR>");
  277.                 } else {
  278.                     unless (-s "$PRODUCTS_DIR/$ShortDir/$HomePageName{$ShortDir}") {
  279.                         &PrintHtml("<B>", "ERROR: $HomePageName{$ShortDir} file missing in $ShortDir\n", "<BR>");
  280.                     }
  281.                 }
  282.             }
  283.             $ProdNum = 1;
  284.                     while (<INFOFILE>) {
  285.                 if ($_ =~ /^[     ]*$/ || $_ =~ /^#/) {
  286.                     next;
  287.                 }
  288.                 if ($CHECK eq "true") {
  289.                     unless ($_ =~ /^.*[^     ].*\^$/) {
  290.                         chop($_);
  291.                         &PrintHtml("<B>", "ERROR: Wrong line in $INFOFILENAME: \"$_\"\n", "<BR>");
  292.                     }
  293.                 }
  294.                             $Product=$_;
  295.                             chop($Product);
  296.                             chop($Product);
  297.                             $Products{$ShortDir . $ProdNum} = $Product;
  298.                 #print "jp = $Product\n";
  299.                 $ProdNum++;
  300.                     }
  301.             close(INFOFILE);
  302.             } else {
  303.                     &PrintHtml("", "Can't open $INFOFILENAME\n", "<BR>");
  304.         }
  305.     }
  306.     #foreach $ShortDir (sort keys(%Companies)) {
  307.         #print "$Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}\n";
  308.     #}
  309.     #%RevComp = reverse %Companies;
  310.     #if (@RevComp != @Companies) {
  311.         #print "WARNING: two directory with the same company name->possible problem!\n";
  312.     #}
  313.     %RevProd = reverse %Products;
  314.     if (@RevProd != @Products) {
  315.         &PrintHtml("", "WARNING: two products with the same name->possible problem!\n", "<BR>");
  316.     }
  317.     #print @Products;
  318.     foreach $ShortDir (sort keys(%Products)) {
  319.         print "$ShortDir, $Products{$ShortDir}\n";
  320.     }
  321.     #foreach $ShortDir (sort keys(%RevProd)) {
  322.         #print "$ShortDir, $RevProd{$ShortDir}\n";
  323.     #}
  324.     #foreach $ShortDir (sort keys(%RevComp)) {
  325.         #print "$RevComp{ShortDir}\n";
  326.     #}
  327.     #print %RevComp;
  328. }
  329.  
  330. sub FilteredSort
  331. {
  332.     ($al = $a) =~ tr/A-Z/a-z/;
  333.     $al =~ s/^the //;
  334.     $al =~ s/^\.//;
  335.     $al =~ s/^[     ]*//;
  336.  
  337.     ($bl = $b) =~ tr/A-Z/a-z/;
  338.     $bl =~ s/^the //;
  339.     $bl =~ s/^\.//;
  340.     $bl =~ s/^[     ]*//;
  341.  
  342.     $al cmp $bl;
  343. }
  344. sub FilteredSortComp
  345. {
  346.     $al = $Companies{$a};
  347.     $al =~ tr/A-Z/a-z/;
  348.     $al =~ s/^the //;
  349.     $al =~ s/^\.//;
  350.     $al =~ s/^[     ]*//;
  351.  
  352.     $bl = $Companies{$b};
  353.     $bl =~ tr/A-Z/a-z/;
  354.     $bl =~ s/^the //;
  355.     $bl =~ s/^\.//;
  356.     $bl =~ s/^[     ]*//;
  357.  
  358.     #print STDOUT "$al =? $bl\n";
  359.     $al cmp $bl;
  360. }
  361.  
  362. ##############################################################################
  363. # CreateSoft
  364. ##############################################################################
  365. sub CreateSoft
  366. {
  367.     &PrintHtml("<BR>", "\nCreating Software page...\n", "<BR>");
  368.     $SOFTFILENAME = "$CAT_DIR/Software.html";
  369.     $SOFTHEADFILENAME = "$CAT_DIR/Software.head.html";
  370.     if (open (SOFTFILE, "> $SOFTFILENAME") && open(SOFTHEADFILE, "> $SOFTHEADFILENAME")) {
  371.         $old = select(SOFTHEADFILE);
  372.         $~ = "SOFTWAREHEAD"; 
  373.         write SOFTHEADFILE;   
  374.         close (SOFTHEADFILE); 
  375.  
  376.         select(SOFTFILE);
  377.         $~ = "CATBEGIN";
  378.         write SOFTFILE;
  379.  
  380.         $Letter = "0";
  381.         foreach $Cat (sort FilteredSort keys(%Categories)) {
  382.             unless ($Categories{$Cat} eq "") {
  383.                 $CatAb = $Categories{$Cat};
  384.                 $CatAb =~ tr/a-z/A-Z/;
  385.                 $CatAb =~ s/^THE //;
  386.                 $CatAb =~ s/^\.//;
  387.                 #print STDOUT "$CatAb, $Letter\n";
  388.                 unless ($CatAb =~ /^$Letter/) {
  389.                     $Letter = substr($CatAb, 0, 1);
  390.                     print SOFTFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  391.                     #push (@Letters, $Letter);
  392.                 }
  393.                 print SOFTFILE "<DD><a href=\"http://localhost:7999/cgi-bin/show.bat/?DEST=$Cat&SIZE=42\"><B>$Categories{$Cat}</B></a><br>\n";
  394.             }
  395.         }
  396.         $~ = "CATEND";
  397.         write SOFTFILE;
  398.  
  399.         close (SOFTFILE);
  400.         select($old);
  401.     }
  402.     &PrintHtml("<DD>", "\tSoftware.html page created.\n", "<BR>");
  403. }
  404.  
  405. ##############################################################################
  406. # CreateCat: 
  407. ##############################################################################
  408. sub CreateCat
  409. {
  410.  
  411.     foreach $catword  ( sort keys(%Categories)) {
  412.         #chop $catword;
  413.         &PrintHtml("<BR>", "\nCreating $catword category page ...\n", "<BR>");
  414.              $CATFILENAME = "$CAT_DIR/$catword.html";
  415.              $CATHEADFILENAME = "$CAT_DIR/$catword.head.html";
  416.         #print STDOUT "Bef open, $CATFILENAME, $CATHEADFILENAME\n";
  417.         if (open (CATFILE, "> $CATFILENAME") && open(CATHEADFILE, "> $CATHEADFILENAME")) {
  418.             $old = select(CATFILE);
  419.  
  420.             $~ = "CATBEGIN";
  421.             write CATFILE;
  422.             $Letter = "0";
  423.             @Letters = ();
  424.             foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  425.                 $Comp = $Companies{$ShortName};
  426.                 #print STDOUT "$ShortName, $Comp\n";
  427.                 
  428.                 unless ($ChosenCat{$ShortName} =~ /$catword/ 
  429.                     || $catword eq "companies") {
  430.                     next;
  431.                 }
  432.                 $CompAb = $Comp;
  433.                 $CompAb =~ tr/a-z/A-Z/;
  434.                 $CompAb =~ s/^THE //;
  435.                 $CompAb =~ s/^\.//;
  436.                 unless ($CompAb =~ /^$Letter/) {
  437.                     $Letter = substr($CompAb, 0, 1);
  438.                     print CATFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  439.                     push (@Letters, $Letter);
  440.                 }
  441.  
  442.                     #print CATFILE "     <DD><a HREF=http://localhost:7999/$ShortName/$HomePageName{$ShortName}><B>$Comp</B></a> $Description{$ShortName}\n";
  443.                     print CATFILE "     <DD><a HREF=http://localhost:7999/$ShortName/$FRAMEBASICNAME><B>$Comp</B></a> $Description{$ShortName}\n";
  444.                                 print "<dd><b><i>", $Products{$ShortName . "1"}, "</i></b>\n" ;                             
  445.                                 if ($Products{$ShortName . "2"} ne "") {
  446.                                         print ", <b><i>", $Products{$ShortName . "2"}, "</i></b>\n" ;
  447.                                 }
  448.                                 if ($Products{$ShortName . "3"} ne "") {
  449.                                         print ", <b><i>", $Products{$ShortName . "3"}, "</i></b>\n" ;
  450.                                 }
  451.                                 if ($Products{$ShortName . "4"} ne "") {
  452.                                         print ", <b><i>", $Products{$ShortName . "4"}, "</i></b>\n" ;
  453.                                 }
  454.                                 if ($Products{$ShortName . "5"} ne "") {
  455.                                         print ", <b><i>", $Products{$ShortName . "5"}, "</i></b>\n" ;
  456.                                 }
  457. #
  458. #        This is for testdrive, install, and demo images
  459. #
  460.                 if ($Platform{$ShortName} =~ /demo/ ) {
  461.                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/demo.gif\">";
  462.                 }
  463.                                 if ($Platform{$ShortName} =~ /testdrive/ ) { 
  464.                                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/testdrive.gif\">";
  465.                                 } 
  466.                                 if ($Platform{$ShortName} =~ /install/ ) { 
  467.                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/install.gif\">";
  468.                                 } 
  469.                 print CATFILE "\n";
  470.  
  471.                 }
  472.          
  473.         
  474.             $~ = "CATEND";
  475.             write CATFILE;
  476.             close (CATFILE);
  477.         
  478.             if ($Special{$catword} eq "") {
  479.                 $AppWidth="596"; 
  480.                  $AppHeight="75";
  481.             } else {
  482.                 @tmp=split(/,/,$Special{$catword});
  483.                                 $AppWidth=@tmp[0]; 
  484.                 $AppHeight=@tmp[1];
  485.             } 
  486.                 
  487.                         #&PrintHtml("<DD>", "\ttest $AppWidth $AppHeight $Special{$catword} $catword\n", "<BR>");
  488.  
  489.             select(CATHEADFILE);
  490.             $~ = "CATHEADERBEGIN";
  491.             write CATHEADFILE;
  492.  
  493.         print CATHEADFILE "<IMG border=0 SRC=\"$DIR_IMAGES/$GifImage{$catword}\"  alt=\"\" USEMAP=#banner ismap>";
  494.         #if ($catword ne "companies") {
  495.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=27,4,96,44>\n";
  496.         #} else {
  497.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=7,12,69,40>\n";
  498.         #}
  499.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=products\" COORDS=3,48,69,80>\n";
  500.         #if ($catword ne "Hardware") {
  501.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Hardware\" COORDS=96,0,165,40>\n";
  502.         #} else {
  503.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/docs\/info\/Info.html\" COORDS=73,6,142,46>\n";
  504.         #}
  505.         #if ($catword ne "Services" && $catword ne "companies" && $catword ne "internet") {
  506.             #        print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Services\" COORDS=96,38,165,78>\n";
  507.         #} else {
  508.             print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/index.html\" COORDS=72,40,143,85>\n";
  509.         #}
  510.                 #if ($catword eq "Sun") {
  511.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Sun_Software&SIZE=35\" COORDS=198,85,366,170>\n";
  512.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Sun_Hardware&SIZE=35\" COORDS=401,85,575,170>\n";
  513.         #}
  514.         #if ($catword eq "internet") {
  515.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"../.Internet/cover.htm\" COORDS=180,0,596,166>\n";
  516.         #} else {
  517.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http://localhost:7999/SunSolutions/index.html\" COORDS=198,0,596,62>\n";
  518. #}
  519.         $~ = "CATHEADERMIDDLE";
  520.         write CATHEADFILE;
  521.  
  522.                 #print CATHEADFILE `cat $Header{$catword}`;
  523.             unless ($Categories{$catword} eq "") {
  524.                     print CATHEADFILE "<CENTER><FONT SIZE=24>$Categories{$catword}</FONT></CENTER>";
  525.             }
  526.     
  527.             #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  528.             if (@Letters > 1) {
  529.                 print CATHEADFILE "<B>Go to:  ";
  530.                 foreach $letter (@Letters) {
  531.                     print CATHEADFILE "<A HREF=\"?DEST=$catword&L=$letter" . ($Categories{$catword} eq ""? "" : "&SIZE=42") . "\">$letter</A>\n";
  532.                 }
  533.             }
  534.             $~ = "CATHEADEREND";
  535.             write CATHEADFILE;
  536.             close (CATHEADFILE);
  537.      
  538.             &PrintHtml("<DD>", "\t$catword category page created.\n", "<BR>");
  539.  
  540.             select($old);
  541.         } else {
  542.             die "\nERROR: Cannot write $CATFILENAME or $CATHEADFILENAME!\nTry to be superuser!\n\n";
  543.         }
  544.     }
  545. }
  546.  
  547. ##############################################################################
  548. # CreateReport:
  549. ##############################################################################
  550. sub CreateReport
  551. {
  552.     $TotalSize = 0;
  553.     foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  554.         #$ShortName = $RevComp{$Comp};    
  555.         $Comp = $Companies{$ShortName};
  556.         &PrintHtml("<B>", "$Comp:\n", "</B><BR>");
  557.         &PrintHtml("<DD>", "\tProduct1: " . $Products{$ShortName . "1"} . "\n", "<BR>");
  558.         if ($Products{$ShortName . "2"} ne "") {
  559.             &PrintHtml("<DD>", "\tProduct2: " . $Products{$ShortName . "2"} . "\n", "<BR>");
  560.         }
  561.         if ($Products{$ShortName . "3"} ne "") {
  562.             &PrintHtml("<DD>", "\tProduct3: " . $Products{$ShortName . "3"} . "\n", "<BR>");
  563.         }
  564.         if ($Products{$ShortName . "4"} ne "") {
  565.             &PrintHtml("<DD>", "\tProduct4: " . $Products{$ShortName . "4"} . "\n", "<BR>");
  566.         }
  567.         if ($Products{$ShortName . "5"} ne "") {
  568.             &PrintHtml("<DD>", "\tProduct5: " . $Products{$ShortName . "5"} . "\n", "<BR>");
  569.         }
  570.         $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  571.         chop $Size;
  572.         $Size =~ s/(\d*).*/\1/;
  573.         &PrintHtml("<DD>", "\tTotal size: $Size Kb\n", "<BR>");
  574.         $TotalSize += $Size;
  575.         if ( $Platform{$ShortName} =~ /demo|testdrive|install/) {
  576.             &PrintHtml("<DD>", "\t", "");
  577.             if ($Platform{$ShortName} =~ /demo/) {
  578.                 &PrintHtml("", "Slide-show, ", "");
  579.             }
  580.             if ($Platform{$ShortName} =~ /testdrive/) {
  581.                 &PrintHtml("", "Demo version, ", "");
  582.             }
  583.             if ($Platform{$ShortName} =~ /install/) {
  584.                 &PrintHtml("", "Unlockable version, ", "");
  585.             }
  586.             &PrintHtml("", "\n", "<BR>");
  587.         }
  588.     }
  589.     &PrintHtml("<BR><BR>", "\n\nTotal size for all companies: $TotalSize Kb\n", "<BR>");
  590.     $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  591.     chop $Size;
  592.     $Size =~ s/(\d*).*/\1/;
  593.     &PrintHtml("", "Total size for .products: $Size Kb\n", "<BR>");
  594. }
  595.  
  596. ##############################################################################
  597. # CreateApplet:
  598. ##############################################################################
  599. sub CreateApplet
  600. {
  601.     &PrintHtml("", "\nBuilding Control bar applets ...\n", "<BR>");
  602.     $TmpFile = "/tmp/tmpupdateapplet";
  603.     foreach $Comp (sort keys(%Companies)) {
  604.         $FRAMEFILENAME = "$PRODUCTS_DIR/$Comp/$FRAMEBASICNAME";
  605.         if (open (FRAMEFILE, "> $FRAMEFILENAME")) {
  606.             print FRAMEFILE "<html> <head>\n<title>Sun Solutions October 1996: $Companies{$Comp}</title>\n</head>\n<FRAMESET ROWS=\"50,*\">\n<FRAME SCROLLING=\"no\" TARGET=\"_top\" NAME=\"menu\" NORESIZE SRC=\"SunSolutions.head.html\">\n<FRAME SCROLLING=\"yes\" NAME=\"content\" NORESIZE MARGINHEIGHT=4 SRC=\"$HomePageName{$Comp}\">\n</BODY> </NOFRAME> </FRAMESET> </HTML>\n";
  607.             close(FRAMEFILE);
  608.         } else {
  609.             &PrintHtml("", "ERROR: Couldn't write $FRAMEFILENAME\n", "<BR>");
  610.         }
  611.  
  612.         $HEADFILENAME = "$PRODUCTS_DIR/$Comp/$HEADBASICNAME";
  613.         if (open (HEADFILE, "> $HEADFILENAME")) {
  614.             print HEADFILE "<html> <head>\n<title>Sun Solutions October 1996</title>\n</head>\n<BODY>\n<CENTER>\n<applet code=ImageMap.class width=596 height=36>\n<param name=highlight value=\"brighter60\">";
  615.             
  616.             $TestGif = 0;
  617.             if ($Platform{$Comp} =~ /demo/) {
  618.                 $TestGif ++;
  619.             }
  620.             if ($Platform{$Comp} =~ /testdrive/) {
  621.                 $TestGif += 2;
  622.             }
  623.             if ($Platform{$Comp} =~ /install/) {
  624.                 $TestGif += 4;
  625.             }
  626.             @BarFileNames = ("none", "rd", "td", "tdrd", "ts", "tsrd", "tdts", "samplebar");
  627.             print HEADFILE "<param name=img value=\"$PRODUCTS_DIR/SunSolutions/images/$BarFileNames[$TestGif].gif\">\n";
  628.  
  629.             print HEADFILE "<param name=area1 value=\"HrefButtonArea,0,0,80,35,http://localhost:7999/cgi-bin/show.bat/?DEST=companies\" >\n";
  630.             print HEADFILE "<param name=area2 value=\"HrefButtonArea,81,0,84,35,http://localhost:7999/SunSolutions/search.html\" >\n";
  631.             print HEADFILE "<param name=area3 value=\"HrefButtonArea,164,0,83,35,http://localhost:7999/SunSolutions/docs/info/Info.html\" >\n";
  632.             print HEADFILE "<param name=area4 value=\"HrefButtonArea,267,0,85,35,http://localhost:7999/cgi-bin/req_more_info.pl?$Comp\" >\n";
  633.  
  634.             $Area = 5;
  635.             if ($Platform{$Comp} =~ /demo/) {
  636.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,350,0,83,35,http://localhost:7999/$Comp/_install/install_show.sh\">\n";
  637.                 $Area ++;
  638.             }
  639.             if ($Platform{$Comp} =~ /testdrive/) {
  640.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,434,0,81,35,http://localhost:7999/$Comp/_install/run.sh\">\n";
  641.                 $Area ++;
  642.             }
  643.             if ($Platform{$Comp} =~ /install/) {
  644.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,515,0,83,35,http://localhost:7999/$Comp/_install/install.sh\">\n";
  645.             }
  646.             
  647.             print HEADFILE "</applet> </CENTER> </BODY> </HTML>\n";
  648.  
  649.  
  650.             close(HEADFILE);
  651.         } else {
  652.             &PrintHtml("", "ERROR: Couldn't write $HEADFILENAME\n", "<BR>");
  653.         }
  654.  
  655.              #$HOMEFILENAME = "../$Comp/" . $HomePageName{$ShortDir};
  656.         #if (open (HOMEFILE, "$HOMEFILENAME")) {
  657.             #open (TMPFILE, "$TmpFile");
  658.             #while (<TMPFILE>) {
  659.                 #$Line = $_;
  660.                 #if ($Line =~ /^<applet class=cdbar/i) {
  661.                     #while (! <HOMEFILE> =~ /^<\/applet>/i) {
  662.                     #}
  663.                     #$TestGif = 0;
  664.                     #if ($Platform{$Comp} =~ /demo/) {
  665.                         #$TestGif ++;
  666.                     #}
  667.                     #if ($Platform{$Comp} =~ /testdrive/) {
  668.                         #$TestGif ++;
  669.                     #}
  670.                     #if ($Platform{$Comp} =~ /install/) {
  671.                         #$TestGif ++;
  672.                     #}
  673.                     #print TMPFILE "<app class=CDbar img=\"http://localhost:7999/SunSolutions/images/none.gif";
  674.                     #print TMPFILE "highlight=brighter60";
  675. ##            print "area1=HrefButtonArea,0,0,80,35,http://localhost:7999/SunSolutions/index.html" >> applet
  676. ##            print "area2=HrefButtonArea,81,0,84,35,http://localhost:7999/.categories/companies.html" >> applet
  677. ##            print "area3=HrefButtonArea,164,0,83,35,http://localhost:7999/SunSolutions/docs/info/Info.html" >> applet
  678. ##            print "area4=HrefButtonArea,267,0,85,35,http://localhost:7999/DEV/disabled.html" >> applet
  679. ##            print ">" >> applet
  680. ##                        breaksw    
  681. ## 
  682.                     #next;
  683.                 #}
  684.                 #print TMPFILE $Line;
  685.             #}
  686.         #}
  687.         #rename($TmpFile, $HOMEFILENAME);
  688.     }
  689.     &PrintHtml("", "\tControl bar applets built...\n", "<BR>");
  690. }
  691. ###############################################################################
  692. ## CreateNames
  693. ###############################################################################
  694. sub CreateNames
  695. {
  696. open (REALNAMES, "> $PRODUCTS_DIR/.bin/real_names.txt");
  697.    write REALNAMES;
  698.     foreach $comp (keys(%Companies)) {
  699.         print REALNAMES "$comp\t$Companies{$comp}\n";
  700.     }
  701. # this is for directories without _info files
  702.    print REALNAMES "SunProducts\tSun Products\n";
  703.    print REALNAMES ".Internet\tInternet Articles\n";
  704. close(REALNAMES);
  705. }
  706.  
  707. ###############################################################################
  708. ## CreateProduct
  709. ###############################################################################
  710. sub CreateProduct
  711. {
  712.     &PrintHtml("<BR>", "\nCreating Products page...\n", "<BR>");
  713.  
  714.          $PRODFILENAME = "$CAT_DIR/products.html";
  715.          $PRODHEADFILENAME = "$CAT_DIR/products.head.html";
  716.     if (open (PRODFILE, "> $PRODFILENAME") && open(PRODHEADFILE, "> $PRODHEADFILENAME")) {
  717.         $old = select(PRODFILE);
  718.  
  719.         $~ = "CATBEGIN";
  720.         write PRODFILE;
  721.         $Letter = "0";
  722.         @Letters = ();
  723.         foreach $Prod (sort FilteredSort keys(%RevProd)) {
  724.             $ShortName = substr($RevProd{$Prod}, 0, length($RevProd{$Prod}) - 1);    
  725.             
  726.             #print STDOUT "        Prod=$Prod, ShortName=$ShortName.\n";
  727.             $ProdAb = $Prod;
  728.             $ProdAb =~ tr/a-z/A-Z/;
  729.             $ProdAb =~ s/^THE //;
  730.             $ProdAb =~ s/^\.//;
  731.             $ProdAb =~ s/^[     ]*//;
  732.             unless ($ProdAb =~ /^$Letter/) {
  733.                 $Letter = substr($ProdAb, 0, 1);
  734.                 print PRODFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  735.                 push (@Letters, $Letter);
  736.             }
  737.  
  738.                 #print PRODFILE "<DD><A HREF=http://localhost:7999/$ShortName/$HomePageName{$ShortName}><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>\n";
  739.                 print PRODFILE "<DD><A HREF=http://localhost:7999/$ShortName/$FRAMEBASICNAME><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>";
  740. #
  741. #     this is for testdrive, install, demo icons
  742. #
  743.                                 if ($Platform{$ShortName} =~ /demo/ ) {
  744.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/demo.gif\">";
  745.                                 }
  746.                                 if ($Platform{$ShortName} =~ /testdrive/ ) {
  747.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/testdrive.gif\">";
  748.                                 }
  749.                                 if ($Platform{$ShortName} =~ /install/ ) {
  750.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/install.gif\">";
  751.                                 }
  752.                                 print PRODFILE "\n";
  753.  
  754.             }
  755.      
  756.         $~ = "CATEND";
  757.         write PRODFILE;
  758.         close (PRODFILE);
  759.  
  760.         select(PRODHEADFILE);
  761.         $~ = "CATHEADERBEGIN";
  762.         write PRODHEADFILE;
  763.                 print PRODHEADFILE "<IMG border=0 SRC=\"$DIR_IMAGES/products.gif\"  alt=\"\" USEMAP=#banner ismap>";
  764.         print PRODHEADFILE "<MAP Name=\"banner\">";
  765.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=7,12,69,40>\n";
  766.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=products\" COORDS=3,48,69,80>\n";
  767.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/docs\/info\/Info.html\" COORDS=73,6,142,46>\n";
  768.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/index.html\" COORDS=72,40,143,85>\n";
  769.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http://localhost:7999/SunSolutions/index.html\" COORDS=200,0,595,74>\n";
  770.  
  771.         print PRODHEADFILE "</MAP></td><tr><td><center>";
  772.         #$~ = "CATHEADERMIDDLE";
  773.         #write PRODHEADFILE;
  774.  
  775.             #print PRODHEADFILE `cat $Header{$catword}`;
  776.         #unless ($Categories{$catword} eq "") {
  777.                 #print PRODHEADFILE "<H1>$Categories{$catword}</H1>";
  778.         #}
  779.  
  780.         #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  781.         print PRODHEADFILE "<B><FONT size=\"4\"> Go to:\n";
  782.         foreach $letter (@Letters) {
  783. # below changed by Marc
  784.             #print PRODHEADFILE "<A HREF=\"?DEST=$catword&L=$letter\">$letter</A>\n";
  785.             print PRODHEADFILE "<A HREF=\"?DEST=products&L=$letter\">$letter</A>\n";
  786.         }
  787.         $~ = "CATHEADEREND";
  788.         write PRODHEADFILE;
  789.         close (PRODHEADFILE);
  790.  
  791.         &PrintHtml("<DD>", "\tproducts.html page created.\n", "<BR>");
  792.  
  793.         select($old);
  794.     }
  795. }
  796. ##############################################################################
  797. # MAIN PART: Decode the parameters and calls the correct subfunctions
  798. ##############################################################################
  799. #$arg0=$0
  800. #$DIR=$arg0:h
  801. #$ProgName=$arg0:t
  802.  
  803. #if ("X$DIR" == "X$ProgName") {
  804.     #$DIR='.'
  805. #}
  806.  
  807. #if (-e "./$ProgName") {
  808.     #$DIR=$cwd
  809. #}
  810.  
  811. #cd  $DIR
  812. #print `pwd`;
  813.  
  814. #
  815. # Create the category pages seen in the categories.txt file
  816. #
  817.  
  818. #foreach $en (sort keys %ENV) {
  819.     #print "$en = $ENV{$en}\n";
  820. #}
  821.  
  822.  
  823.     $CATS = "false";
  824.     $APPLETS = "false";
  825.     $COMP = "false";
  826.     $CHECK = "false";
  827.     $REPORT = "false";
  828.     $HTML_FORMAT = "false";
  829.     $PROD = "false";
  830.     $SOFT = "false";
  831.     $PLATFORM = "sparc";
  832.  
  833.     $DIR_IMAGES = "http://localhost:7999/SunSolutions/images/";
  834.     $PRODUCTS_DIR = "../";
  835.  
  836.     # parse command line arguements
  837.  
  838.     #print "Arg=@ARGV.\n";
  839.     @ARGREPORT = @ARGV;
  840.     if (@ARGV == 0) {
  841.         @ARGV=("-?");
  842.     }
  843.  
  844.         while ($ARGV[0] =~ /^-/) {
  845.             $_ = shift;
  846.             #print "Arg=$_.\n";
  847.             if (/^-cats$/) {
  848.                 $CATS = "true";
  849.             } elsif (/^-applets/) {
  850.                 $APPLETS = "true";
  851.             } elsif (/^-comp/) {
  852.                 $COMP = "true";
  853.             } elsif (/^-checkall/) {
  854.                 $CHECK = "true";
  855.                 $CHECKLINKS = "true";
  856.             } elsif (/^-checklinks/) {
  857.                 $CHECKLINKS = "true";
  858.             } elsif (/^-check/) {
  859.                 $CHECK = "true";
  860.             } elsif (/^-soft/) {
  861.                 $SOFT = "true";
  862.             } elsif (/^-report/) {
  863.                 $REPORT = "true";
  864.             } elsif (/^-html/) {
  865.                 $HTML_FORMAT = "true";
  866.                         } elsif (/^-names/) {
  867.                                 $NAMES = "true";
  868.             } elsif (/^-dir/) {
  869.                 $PRODUCTS_DIR = ($1 ? $1 : shift);
  870.                 unless (-s $PRODUCTS_DIR) {
  871.                     die "ERROR: $PRODUCTS_DIR is not a directory\n";
  872.                 }
  873.             } elsif (/^-prod/) {
  874.                 $PROD = "true";
  875.             } elsif (/^-all/) {
  876.                 $PROD = "true" ;
  877.                 $COMP = "true";
  878.                 $SOFT = "true";
  879.                 $APPLETS = "true";
  880.                 $CATS = "true";
  881.                 $NAMES = "true";
  882.             } elsif (/^-x86/) {
  883.                 $PLATFORM = x86;
  884.                 $SRC_DIR = "../../../x86.image";
  885.             } elsif (/^-[?Hh]/) {
  886.                 die "Usage: update.pl [ -cats | -applets | -soft | -prod | -all | -dir dirname | -x86  | -report | -html | -names | -check]\n\tall: = -cats -prod -applets\n\tapplets: creates an applet in the customer home page.\n\tcats: creates the category and company pages.\n\tcheck: check the _info file, and other things for errors.\n\tdir: gives the directory where the companies are located.\n\thtml: when -report is selected, creates an output in HTML format.\n\tnames: create list of company names keyed on directory name.\n\tprod: creates the product page.\n\treport: creates a report for all companies.\n\tsoft: creates the Software pages\n\tx86: for future usage.\n";
  887.             } else {
  888.                 die "Unrecognized switch: $_ (try -?)\n";
  889.             }
  890.         }
  891.  
  892. &PrintHtml("<HTML> <HEAD> <title>Sun Solutions - status on " . `date` . "</title> </HEAD> <BODY bgcolor=\"#DDDDDD\"><H1>", "Sun Solutions - status on " . `date` . "\n", "</H1>");
  893.  
  894.  
  895. # check if root user
  896. if ( $ENV{"USER"} ne "root" ) {
  897.         &PrintHtml("", "WARNING: This program should be run as root user.\n", "<BR>");
  898.     }
  899.  
  900.  
  901.     if ($REPORT ne "true") {
  902.         $HostName = `hostname`;
  903.         chop $HostName;
  904.         &PrintHtml("", "\nUpdating Sun Solutions on $HostName:\n\n", "<BR>");
  905.     if (open (REPORTFILE, ">> $PRODUCTS_DIR/.update.txt")) {
  906.         $Date = `date`;
  907.         chop $Date;
  908.         print REPORTFILE "update by " . $ENV{"USER"} . " on $Date from $HostName\n\tparams: ";
  909.         while (@ARGREPORT) {
  910.             print REPORTFILE "$ARGREPORT[0], ";
  911.             shift @ARGREPORT;
  912.         }
  913.         print REPORTFILE "\n\n";
  914.         close (REPORTFILE);
  915.     } else {
  916.         &PrintHtml("", "WARNING: Cannot open $PRODUCTS_DIR/.update.txt\n", "<BR>");
  917.     }
  918. }
  919.  
  920. &InitCompInfo();
  921.  
  922. $CAT_DIR = "$PRODUCTS_DIR/.categories";
  923. $FRAMEBASICNAME = "SunSolutions.frame.html";
  924. $HEADBASICNAME = "SunSolutions.head.html";
  925. #print $CAT_DIR;
  926. if ( ! -d $CAT_DIR ) {
  927.     mkdir($CAT_DIR, 0777);
  928. }
  929.  
  930. if ( $CHECK eq "true" ) {
  931.     &CheckFiles();
  932. }
  933. if ( $NAMES eq "true" ) {
  934.         &CreateNames();  
  935. }
  936.  
  937.  
  938. if ( $CHECKLINKS eq "true" ) {
  939.     &CheckLinks();
  940. }
  941.  
  942. if ( $CATS eq "true" ) {
  943.     &CreateCat();
  944. }
  945.  
  946. if ( $SOFT eq "true" ) {
  947.     &CreateSoft();
  948. }
  949.  
  950. #
  951. # Get all SunSolutions menu bar components and put in file 
  952. # for building of front page applet 
  953. #
  954. if ( $APPLETS eq "true" ) {
  955.     &CreateApplet();
  956. }
  957.  
  958. if ( $PROD eq "true" ) {
  959.     &CreateProduct();
  960. }
  961.  
  962. if ( $REPORT eq "true" ) {
  963.     &CreateReport();
  964. }
  965.  
  966. #
  967. # Compile list of companies, place in 'companies' file
  968. #
  969. #if ( $COMP eq "true" ) {
  970.     #&CreateComp();
  971. #}
  972.  
  973. #
  974. # Compile list of products, place in 'products' file
  975. #
  976.  
  977. #print "\n\n\nPress <RETURN> to close the window and test your submission..\n.";
  978. #read answer;
  979.  
  980. ################################################################################
  981. # Define FORMATS (no more code)
  982. ################################################################################
  983. format CATHEADERBEGIN =
  984. <html>
  985. <body  BGCOLOR="#8c8cde" link=#33ff00 vlink=#33ff00 >
  986. <BASE TARGET="_top" HREF="http://localhost:7999/cgi-bin/show.bat/">
  987. <center>
  988. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions">
  989. <table border = 3><td>
  990. <MAP Name="banner">
  991. .
  992.  
  993. format CATHEADERMIDDLE =
  994. </MAP></td><tr><td><center>
  995. <B><FONT size="4">
  996. #<B>Go to:  </b>
  997. .
  998.  
  999. format CATHEADEREND =
  1000. #<br> Search: <input type="text" name="isindex" size="12" >
  1001. </font>
  1002. </td><tr></table>
  1003. </form>
  1004. </center>
  1005. </body>
  1006. </html>
  1007. .
  1008.  
  1009. format CATBEGIN =
  1010. <HTML>
  1011.         <!-- header section-->
  1012. <HEAD>
  1013. <title>Sun Solutions - October</title>
  1014. </HEAD>
  1015.         <!-- document body-->
  1016. <BODY bgcolor="#DDDDDD">
  1017. <BASE TARGET="_top">
  1018. <DL>
  1019. #<hr>
  1020. #<p>
  1021. .
  1022.  
  1023. format CATEND =
  1024. </B></B><DT>
  1025. <hr>
  1026. </BODY>
  1027. </HTML>
  1028. .
  1029.  
  1030. format SOFTWAREHEAD =
  1031. <HTML>
  1032.         <!-- header section-->
  1033. <HEAD>
  1034. <TITLE>Sun Solutions - Software Categories</TITLE>
  1035. </HEAD>
  1036.         <!-- document body-->
  1037. <BODY BGCOLOR="8c8cde" link=#33ff00 vlink=#33ff00>
  1038. <CENTER>
  1039. <BASE TARGET="_top" HREF="http://localhost:7999/cgi-bin/show.bat/">
  1040. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions">
  1041. <table border = 3><td>
  1042. <IMG border=0 SRC="http://localhost:7999/SunSolutions/images/software.gif" alt="" USEMAP=#banner ismap>
  1043. <MAP Name="banner">
  1044. <AREA SHAPE="RECT" HREF="?DEST=companies" COORDS=7,12,69,40>
  1045. <AREA SHAPE="RECT" HREF="?DEST=products" COORDS=3,48,69,80>
  1046. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/docs/info/Info.html" COORDS=73,6,142,46>
  1047. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/index.html" COORDS=72,40,143,85>
  1048. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/index.html" COORDS=200,0,595,74>
  1049. </MAP>
  1050. </TD><TR><TD>
  1051. <CENTER>
  1052. <FONT size="4">
  1053. #<br>Search: <input type="text" name="isindex" size="12" >
  1054. </font>
  1055. </CENTER>
  1056. </td><tr></table>
  1057. </CENTER>
  1058. </form>
  1059. </BODY>
  1060. </HTML>
  1061. .
  1062. ##############################################################################
  1063. format FRAMEHEADER =
  1064. Content-type: text/html
  1065.  
  1066.  
  1067.  
  1068. <html>
  1069. <head>
  1070. <title>Sun Solutions October 1996</title>
  1071. </head>
  1072. <FRAMESET ROWS="20,80">
  1073. #$size
  1074. .
  1075. ##############################################################################
  1076. format FRAMEFOOTER =
  1077. <BODY BACKGROUND="icons/bkgrnds/homebg.gif" body bgcolor=black text=#ffffff link=#dddddd alink=#ffff00 vlink=#bbbbbb>
  1078.  
  1079. <FONT SIZE=-1>Copyright \0511995 <B><A
  1080.  
  1081. </BODY>
  1082. </NOFRAME>
  1083. </FRAMESET>
  1084. </HTML>
  1085. .
  1086.